/*
 * @Description:
 * @Author: jun.wu
 * @Date: 2022-11-17 11:04:19
 * @LastEditors: jun.wu
 * @LastEditTime: 2022-11-17 11:21:34
 */
import store from "@/store";

export default {
  methods: {
    // 检查权限 有或者没有 key就是要检查的点
    checkPermission(key) {
      // points里有key就是有权限,否则就是没有
      //   store.state.user.userInfo.roles.points
      const { userInfo } = store.state.user;
      if (userInfo.roles && userInfo.roles.points) {
        return userInfo.roles.points.some((item) => {
          item === key;
        });
      }
      return false; //没进入if就是没权限
    },
  },
};
